package com.lyz.dataStructure.dome.CollectionDemo;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:26
 * @Description:
 **/

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/25 20:26
 *@Description:
 **/
public class ArrayListDemo {
    public static void main(String[] args) {
        List arrayList = new ArrayList();
        System.out.println("集合为空："+arrayList.isEmpty());
        System.out.println("集合长度："+arrayList.size());
        arrayList.add(new Date());
        arrayList.add("abc");
        arrayList.add(123);
        arrayList.add(123.0);
        arrayList.add(new Student("张","三"));
        System.out.println("集合长度："+arrayList.size());
        System.out.println("集合为空："+arrayList.isEmpty());
        System.out.println("包含字符串："+arrayList.contains(new String("abc")));//使用equals进行比较
        System.out.println("包含姓名："+arrayList.contains(new Student("张","三")));//没有重写equals方法
        System.out.println(arrayList);
    }
}
